<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html lang="zh-CN">
  <head>
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
	<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/font-awesome.min.css">
	<link rel="stylesheet" href="css/login.css">
	<style>

	</style>
  </head>
  <body>
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <div><a class="navbar-brand" href="index.jsp" style="font-size:32px;">泾阳房管平台</a></div>
        </div>
      </div>
    </nav>

    <div class="container">

      <form class="form-signin" role="form" id="loginform" method="post">
        <h2 class="form-signin-heading"><i class="glyphicon glyphicon-user"></i> 用户登录</h2>
		  <div class="form-group has-success has-feedback">
			<input type="text" class="form-control" id="job" placeholder="请输入登录账号" autofocus name="job">
			<span class="glyphicon glyphicon-user form-control-feedback"></span>
		  </div>
		  <div class="form-group has-success has-feedback">
			<input type="text" class="form-control" id="passWord" name="passWord" placeholder="请输入登录密码" style="margin-top:10px;">
			<span class="glyphicon glyphicon-lock form-control-feedback"></span>
		  </div>
 			
                <input type="checkbox" id="remember" name="isRemenberMe" value="1" /> 记住我
           

		<input type="button" class="btn btn-lg btn-success btn-block" id="login" value="登录" >
      </form>
    </div>
    <script src="${pageContext.request.contextPath}/js/jquery-1.12.3.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script>
   
		$("#login").click(function(){
			 var job=$("#job").val()
			 var passWord=$("#passWord").val();
			 var rem=0;
			 var isRemenberMe=$("#remember").prop("checked")
				if(isRemenberMe==false){
					rem=0;
				}else{
					rem=1;
				}
			 $.post("${pageContext.request.contextPath}/login/dologin",
					 {job:job,passWord:passWord,isRemenberMe:rem},
					 function(data){
						
						if(data=="\"登录成功\""){
							window.location.href="${pageContext.request.contextPath}/index.jsp"
						}else if(data=="\"登录失败\""){
							alert("账号或密码错误，请确认后重新输入。")
						}
					 })
		})
    </script>
  </body>
</html>